/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Description: cast stream manager interface.
 * Author: huangchanggui
 * Create: 2023-02-01
 */

#ifndef I_CAST_STREAM_MANAGER_H
#define I_CAST_STREAM_MANAGER_H

#include "i_stream_player_impl.h"
#include "i_cast_stream_listener.h"
#include "channel_listener.h"
#include "channel.h"

namespace OHOS {
namespace CastEngine {
namespace CastEngineService {
class ICastStreamManager {
public:
    virtual ~ICastStreamManager() = default;

    static std::shared_ptr<ICastStreamManager> GetInstance(std::shared_ptr<ICastStreamListener> listener,
        EndType &endType);
    virtual sptr<IStreamPlayerImpl> CreateStreamPlayer(const std::function<void(void)>& releaseCallback) = 0;
    virtual void ProcessActionsEvent(int event, const std::string &param) = 0;
    virtual std::shared_ptr<IChannelListener> GetChannelListener() = 0;
    virtual void AddChannel(std::shared_ptr<Channel> channel) = 0;
    virtual void RemoveChannel(std::shared_ptr<Channel> channel) = 0;

    static constexpr int MODULE_EVENT_ID_CONTROL_EVENT = 100;
    static constexpr int MODULE_EVENT_ID_CALLBACK_EVENT = 101;
    static constexpr int MODULE_EVENT_ID_CHANNEL_CREATE = 102;
    static constexpr int MODULE_EVENT_ID_CHANNEL_DESTROY = 103;
    static constexpr int MODULE_EVENT_ID_STREAM_CHANNEL = 104;
};
} // namespace CastEngineService
} // namespace CastEngine
} // namespace OHOS
#endif // CAST_STREAM_PLAYER_H